5 'YOU NEED TR.QG, TL.QG, TU.QG, AND TD.QG IN CURRENT DIRECTORY TO RUN THIS GAME.
10 SCREEN 13: s = 0: CLS : ti = 0: am = 0
20 PRINT "              TANK!!!"
35 PRINT : PRINT : PRINT "BY KENNETH GREEN"
30 PRINT : PRINT : PRINT
40 PRINT "MOVE THE TANK WITH THE ARROW KEYS."
50 PRINT "TO CHANGE AMMO, PRESS A."
60 PRINT "TO FIRE AMMO, PRESS F"
65 PRINT "TO END PRESS <Esc>."
67 PRINT : PRINT "There's a time limit and ": PRINT "the game will end."
68 PRINT : PRINT "IF YOUR TANK DISAPPEARS,": PRINT "PRESS AN ARROW KEY."
69 PRINT : PRINT "Don't try and sneak up behind the tank": PRINT "because he can still turn around": PRINT "sometimes."
70 INPUT "PRESS <ENTER> TO START."; ST$
110 CLS : X2 = 100: Y2 = 120: x = 25: y = 25
111 OPEN "TR.QG" FOR RANDOM AS #1 LEN = 2
112 DIM tr%(2050)
113 FOR a = 0 TO 2050
114 GET #1, , tr%(a)
115 NEXT a
116 OPEN "TL.QG" FOR RANDOM AS #2 LEN = 2
117 DIM tl%(2050)
118 FOR a = 0 TO 2050
119 GET #2, , tl%(a)
120 NEXT a
121 OPEN "TU.QG" FOR RANDOM AS #3 LEN = 2
122 DIM tu%(2050)
123 FOR a = 0 TO 2050
124 GET #3, , tu%(a)
125 NEXT a
126 OPEN "TD.QG" FOR RANDOM AS #4 LEN = 2
127 DIM td%(2050)
128 FOR a = 0 TO 2050
129 GET #4, , td%(a)
130 NEXT a
132 PUT (x, y), tr%, PSET
135 r = 20: m = 3
137 ti = 2100
140 a$ = INKEY$: LOCATE 1, 1: PRINT "Score "; s: LOCATE 1, 16: PRINT "Tanks "; m: LOCATE 1, 25: PRINT "Time "; ti
141 IF x > 180 THEN x = 180
142 IF x < 10 THEN x = 10
143 IF y < 7 THEN y = 7
144 IF y > 130 THEN y = 130
145 IF m < 1 THEN 6000
146 ti = ti - 1: IF ti < 0 THEN 3500
147 IF a$ = CHR$(0) + CHR$(77) THEN x = x + 5: SOUND 100, .2: GOTO 1000
150 IF a$ = CHR$(0) + CHR$(75) THEN x = x - 5: SOUND 100, .2: GOTO 1100
151 IF a$ = CHR$(27) THEN 3500
155 IF a$ = CHR$(0) + CHR$(72) THEN y = y - 5: SOUND 100, .2: GOTO 1200
156 IF a$ = "A" OR a$ = "a" THEN 500
157 IF a$ = "F" OR a$ = "f" THEN 1500
160 IF a$ = CHR$(0) + CHR$(80) THEN y = y + 5: SOUND 100, .2: GOTO 1300
161 IF r < 10 THEN 164
163 DR = INT(RND * 20)
164 IF DR = 5 OR DR = 6 THEN r = r + 1: GOTO 1600
165 IF DR = 10 OR DR = 11 THEN r = r + 1: GOTO 1620
166 IF DR = 15 OR DR = 16 THEN r = r + 1: GOTO 1640
167 IF DR = 20 OR DR = 19 THEN r = r + 1: GOTO 1660
195 IF a$ = CHR$(27) THEN END
190 ti = ti - 10: IF ti < 0 THEN 3500
196 IF B2 = 15 THEN B2 = 0
197 B2 = B2 + 1: IF B2 = 10 OR B2 = 14 OR B2 = 5 THEN B = 0
198 IF B = 1 THEN 200
199 GOTO 4000
200 GOTO 140
500 CLS : PRINT "USE WHICH AMMO:"
510 PRINT "(1)50 CALIBUR MACHINE GUN"
520 PRINT "(2)200 CALIBUR TANK BULLET"
530 PRINT "(3)22 CALIBUR PISTOL"
535 IF am = 0 OR am = 2 THEN LC = 3
536 IF am = 1 THEN LC = 2
537 IF am = 3 THEN LC = 4
538 LOCATE LC, 27: PRINT "<-"
540 LOCATE 5, 1: INPUT "CHOOSE A NUMBER HERE:"; am
545 IF am = 0 THEN 500
550 IF am > 3 THEN 500
560 IF am = 0 THEN 570
570 CLS : PUT (x, y), tr%, PSET
600 GOTO 140
1000 PUT (x, y), tr%, PSET: d = 1
1010 GOTO 140
1100 PUT (x, y), tl%, PSET: d = 2
1110 GOTO 140
1200 PUT (x, y), tu%, PSET: d = 3
1210 GOTO 140
1300 PUT (x, y), td%, PSET: d = 4
1310 GOTO 140
1500 IF am = 0 OR am = 2 THEN 1520
1505 IF am = 1 THEN 1550
1510 IF am = 3 THEN 1570
1520 FOR SN = 500 TO 700 STEP 100: SOUND SN, 1: NEXT SN
1530 GOTO 2000
1550 FOR SN = 199 TO 200: SOUND SN, 1: NEXT SN
1560 GOTO 2000
1570 SOUND 400, 1
1580 GOTO 2000
1600 PUT (X2, Y2), tr%, PSET: h = 0
1601 X2 = X2 + 2: r = r - 2
1602 IF X2 < 1 THEN X2 = 1: r = 10
1603 IF X2 > 180 THEN X2 = 180: r = 10
1610 GOTO 1700
1620 PUT (X2, Y2), tl%, PSET: h = 0
1621 X2 = X2 - 2: r = r - 2
1623 IF X2 < 1 THEN X2 = 1: r = 10
1624 IF X2 > 180 THEN X2 = 180: r = 10
1630 GOTO 1700
1640 PUT (X2, Y2), tu%, PSET: h = 0
1641 Y2 = Y2 - 2: r = r - 2
1642 IF Y2 < 7 THEN Y2 = 7: r = 10
1643 IF Y2 > 130 THEN Y2 = 130: r = 10
1650 GOTO 1700
1660 PUT (X2, Y2), td%, PSET: h = 0
1661 Y2 = Y2 + 2: r = r - 2
1662 IF Y2 < 7 THEN Y2 = 7: r = 10
1663 IF Y2 > 130 THEN Y2 = 130: r = 10
1670 GOTO 1700
1700 FOR TM = 1 TO 500: NEXT TM
1710 GOTO 140
2000 'r l u d
2010 IF d = 1 THEN 2100
2020 IF d = 2 THEN 2200
2030 IF d = 3 THEN 2300
2040 IF d = 4 THEN 2400
2100 LINE (x + 34, y + 27)-(210, y + 27): FOR TM = 1 TO 900: NEXT TM: LINE (x + 34, y + 27)-(210, y + 27), 0
2105 IF x > X2 THEN 2120
2110 IF y / Y2 > .78 AND y / Y2 < 1.34 AND h < 3 THEN 3000
2120 GOTO 140
2200 LINE (x + 5, y + 28)-(1, y + 28): FOR TM = 1 TO 900: NEXT TM: LINE (x + 5, y + 28)-(1, y + 28), 0
2205 IF x < X2 THEN 2220
2210 IF y / Y2 > .78 AND y / Y2 < 1.34 AND h < 3 THEN 3000
2220 GOTO 140
2300 LINE (x + 24, y + 13)-(x + 24, 1): FOR TM = 1 TO 900: NEXT TM: LINE (x + 24, y + 13)-(x + 24, 1), 0
2305 IF Y2 > y THEN 2320
2310 IF x / X2 > .78 AND x / X2 < 1.34 AND h < 3 THEN 3000
2320 GOTO 140
2400 LINE (x + 23, y + 46)-(x + 23, 190): FOR TM = 1 TO 900: NEXT TM: LINE (x + 23, y + 46)-(x + 23, 190), 0
2405 IF Y2 < y THEN 2420
2410 IF x / X2 > .78 AND x / X2 < 1.34 AND h < 3 THEN 3000
2420 GOTO 140
3000 h = h + 1
3001 IF am = 0 OR am = 2 THEN 3009
3002 IF am = 1 THEN 3027
3003 IF am = 3 THEN 3030
3009 FOR C = 1 TO 10
3010 CIRCLE (X2 + 22, Y2 + 22), C
3020 SOUND C + 100, .5
2025 NEXT C
3026 GOTO 3038
3027 FOR C = 1 TO 5
3028 CIRCLE (X2 + 22, Y2 + 22), C: SOUND C + 100, .5: NEXT C
3029 GOTO 3038
3030 FOR C = 1 TO 2
3031 CIRCLE (X2 + 22, Y2 + 22), C: SOUND C + 100, .5: NEXT C
3038 IF am = 3 THEN s = s + 50
3039 IF am <> 3 THEN s = s + 100
3040 GOTO 140
3500 LOCATE 10, 1: PRINT "THE   END"
3501 IF ti < 0 THEN ti = 0
3505 LOCATE 1, 25: PRINT "Time "; ti
3510 PRINT : PRINT
3520 INPUT "Do you want to play again(Y/N)"; EX$
3530 CLOSE
3540 IF EX$ = "Y" OR EX$ = "y" THEN 10
3545 END
4000 IF Y2 / y > .7 AND Y2 / y < 1.4 THEN 4100
4010 IF X2 / x > .7 AND X2 / x < 1.4 THEN 4050
4020 GOTO 150
4050 IF Y2 < y THEN 4500 'DOWN
4060 IF Y2 > y THEN 4700'UP
4100 IF X2 < x THEN 5000 'RIGHT
4110 IF X2 > x THEN 5500 'LEFT
4120 GOTO 150
4500 PUT (X2, Y2), td%, PSET
4510 LINE (X2 + 22, Y2 + 22)-(X2 + 22, 200): FOR TM = 1 TO 400: NEXT TM: LINE (X2 + 22, Y2 + 22)-(X2 + 22, 200), 0
4520 FOR C2 = 1 TO 10
4530 CIRCLE (x + 22, y + 22), C2: SOUND 100 + C2, .5: NEXT C2
4540 m = m - 1
4545 B = 1
4546 IF d = 1 THEN PUT (x, y), tr%, PSET
4547 IF d = 2 THEN PUT (x, y), tl%, PSET
4548 IF d = 3 THEN PUT (x, y), tu%, PSET
4549 IF d = 4 THEN PUT (x, y), td%, PSET
4550 GOTO 140
4700 PUT (X2, Y2), tu%, PSET
4710 LINE (X2 + 22, Y2 + 22)-(X2 + 22, 0): FOR TM = 1 TO 400: NEXT TM: LINE (X2 + 22, Y2 + 22)-(X2 + 22, 0), 0
4720 FOR C2 = 1 TO 10
4730 CIRCLE (x + 22, y + 22), C2: SOUND 100 + C2, .5: NEXT C2
4740 m = m - 1
4745 B = 1
4746 IF d = 1 THEN PUT (x, y), tr%, PSET
4747 IF d = 2 THEN PUT (x, y), tl%, PSET
4748 IF d = 3 THEN PUT (x, y), tu%, PSET
4749 IF d = 4 THEN PUT (x, y), td%, PSET
4750 GOTO 140
5000 PUT (X2, Y2), tr%, PSET
5010 LINE (X2 + 22, Y2 + 22)-(200, Y2 + 22): FOR TM = 1 TO 400: NEXT TM: LINE (200, Y2 + 22)-(X2 + 22, Y2 + 22), 0
5020 FOR C2 = 1 TO 10
5030 CIRCLE (x + 22, y + 22), C2: SOUND 100 + C2, .5: NEXT C2
5040 m = m - 1
5045 B = 1
5046 IF d = 1 THEN PUT (x, y), tr%, PSET
5047 IF d = 2 THEN PUT (x, y), tl%, PSET
5048 IF d = 3 THEN PUT (x, y), tu%, PSET
5049 IF d = 4 THEN PUT (x, y), td%, PSET
5050 GOTO 140
5500 PUT (X2, Y2), tl%, PSET
5510 LINE (X2 + 22, Y2 + 22)-(0, Y2 + 22): FOR TM = 1 TO 400: NEXT TM: LINE (0, Y2 + 22)-(X2 + 22, Y2 + 22), 0
5520 FOR C2 = 1 TO 10
5530 CIRCLE (x + 22, y + 22), C2: SOUND 100 + C2, .5: NEXT C2
5540 m = m - 1
5545 B = 1
5546 IF d = 1 THEN PUT (x, y), tr%, PSET
5547 IF d = 2 THEN PUT (x, y), tl%, PSET
5548 IF d = 3 THEN PUT (x, y), tu%, PSET
5549 IF d = 4 THEN PUT (x, y), td%, PSET
5550 GOTO 140
6000 LOCATE 11, 1: PRINT "YOU LOST ALL YOUR TANKS!"
6010 GOTO 3500

